class Solution:
	# @param {integer[]} nums
	# @return {integer}
	def rob(self, nums):
		carry = 0
		non_c = 0
		for n in nums:
			non_c, carry = max(non_c, carry), non_c + n
		return max(carry, non_c)

print Solution().rob([0])